Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(station): Make DR sync + logging more efficient #432

Merged

Conversation

olaszakos
Copy link
Contributor

@olaszakos olaszakos commented Nov 21, 2024

Problem:

  1. The station syncs all assets and accounts to the upgrader on any account and asset change. The accounts change on each balance query since the new balance is saved back to the repository. This results in very frequent unnecessary syncs.
  2. The upgrader log size is growing rapidly. Trimming is necessary, but it cannot be trimmed due to the stable Log structure only supporting append operation.

Task:

  1. only sync assets and accounts when the change is relevant - ie. any field of the DR version of the entries change
  2. switch to a stable BTreeMap to keep the logs and limit the log size to 25k items

Also bundled a small fix for a missing asset foreign key check.

@olaszakos olaszakos marked this pull request as ready for review November 21, 2024 17:42
@olaszakos olaszakos requested a review from a team as a code owner November 21, 2024 17:42
Copy link
Member

@keplervital keplervital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@olaszakos olaszakos merged commit f928e12 into multi-chain-support Nov 21, 2024
19 checks passed
@olaszakos olaszakos deleted the PEN-378-make-dr-sync-logging-more-efficient branch November 21, 2024 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants